<template>
    <view>
        <!--标题和返回-->
		<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
			<block slot="backText">返回</block>
			<block slot="content">资产明细中间表管理</block>
		</cu-custom>
		 <!--表单区域-->
		<view>
			<form>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">集团：</text></view>
                  <input  placeholder="请输入集团" v-model="model.mandt"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产编号：</text></view>
                  <input  placeholder="请输入资产编号" v-model="model.anln1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产子编码：</text></view>
                  <input  placeholder="请输入资产子编码" v-model="model.anln2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">年度：</text></view>
                  <input  placeholder="请输入年度" v-model="model.gjahr"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">期间：</text></view>
                  <input  placeholder="请输入期间" v-model="model.monat"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">科目定位码

：</text></view>
                  <input  placeholder="请输入科目定位码

" v-model="model.ktogr"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">序列号：</text></view>
                  <input  placeholder="请输入序列号" v-model="model.sernr"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">存货号：</text></view>
                  <input  placeholder="请输入存货号" v-model="model.invnr"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产分类
：</text></view>
                  <input  placeholder="请输入资产分类
" v-model="model.anlkl"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产分类描述
：</text></view>
                  <input  placeholder="请输入资产分类描述
" v-model="model.txk20"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">信用范围
：</text></view>
                  <input  placeholder="请输入信用范围
" v-model="model.gsber"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产描述
：</text></view>
                  <input  placeholder="请输入资产描述
" v-model="model.txt50"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">规格型号附加资产描述
：</text></view>
                  <input  placeholder="请输入规格型号附加资产描述
" v-model="model.txa50"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">数量：</text></view>
                  <input type="number" placeholder="请输入数量" v-model="model.menge"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">单位

：</text></view>
                  <input  placeholder="请输入单位

" v-model="model.meins"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">最后库存日
：</text></view>
                  <input  placeholder="请输入最后库存日
" v-model="model.ivdat"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">补充库存说明
：</text></view>
                  <input  placeholder="请输入补充库存说明
" v-model="model.invzu"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产资本化日期
：</text></view>
                  <input  placeholder="请输入资产资本化日期
" v-model="model.aktiv"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">使用状态
：</text></view>
                  <input  placeholder="请输入使用状态
" v-model="model.ord41"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">使用状态描述
：</text></view>
                  <input  placeholder="请输入使用状态描述
" v-model="model.ordt1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">类别名称
：</text></view>
                  <input  placeholder="请输入类别名称
" v-model="model.ord42"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">类别名称描述
：</text></view>
                  <input  placeholder="请输入类别名称描述
" v-model="model.ordt2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">设备属性
：</text></view>
                  <input  placeholder="请输入设备属性
" v-model="model.ord43"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">设备属性描述
：</text></view>
                  <input  placeholder="请输入设备属性描述
" v-model="model.ordt3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">分类
：</text></view>
                  <input  placeholder="请输入分类
" v-model="model.ord44"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">分类描述
：</text></view>
                  <input  placeholder="请输入分类描述
" v-model="model.ordt4"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产来源
：</text></view>
                  <input  placeholder="请输入资产来源
" v-model="model.gdlgrp"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产制造商
：</text></view>
                  <input  placeholder="请输入资产制造商
" v-model="model.herst"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">投资订单
：</text></view>
                  <input  placeholder="请输入投资订单
" v-model="model.eaufn"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">成本中心
：</text></view>
                  <input  placeholder="请输入成本中心
" v-model="model.kostl"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">成本中心描述
：</text></view>
                  <input  placeholder="请输入成本中心描述
" v-model="model.ltext"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产地点
：</text></view>
                  <input  placeholder="请输入资产地点
" v-model="model.stort"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">房间
：</text></view>
                  <input  placeholder="请输入房间
" v-model="model.raumn"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产停用
：</text></view>
                  <input  placeholder="请输入资产停用
" v-model="model.xstil"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产主号说明：</text></view>
                  <input  placeholder="请输入资产主号说明" v-model="model.anlhtxt"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">折旧码
：</text></view>
                  <input  placeholder="请输入折旧码
" v-model="model.afasl"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">计划年使用期
：</text></view>
                  <input  placeholder="请输入计划年使用期
" v-model="model.ndjar"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">计划使用期间
：</text></view>
                  <input  placeholder="请输入计划使用期间
" v-model="model.ndper"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">折旧计算开始日期
：</text></view>
                  <input  placeholder="请输入折旧计算开始日期
" v-model="model.afabg"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产残值
：</text></view>
                  <input type="number" placeholder="请输入资产残值
" v-model="model.schrw"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">已使用年限
：</text></view>
                  <input type="number" placeholder="请输入已使用年限
" v-model="model.ndabj"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">已使用期限余月
：</text></view>
                  <input type="number" placeholder="请输入已使用期限余月
" v-model="model.ndabp"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">累积购置和生产费用
：</text></view>
                  <input type="number" placeholder="请输入累积购置和生产费用
" v-model="model.kansw"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">重置价值的累计重估
：</text></view>
                  <input type="number" placeholder="请输入重置价值的累计重估
" v-model="model.kaufw"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">以前年度累计正常折旧
：</text></view>
                  <input type="number" placeholder="请输入以前年度累计正常折旧
" v-model="model.knafa"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">本年正常折旧
：</text></view>
                  <input type="number" placeholder="请输入本年正常折旧
" v-model="model.nafap"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">该年度影响资产值的业务
：</text></view>
                  <input type="number" placeholder="请输入该年度影响资产值的业务
" v-model="model.answl"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产原值
：</text></view>
                  <input type="number" placeholder="请输入资产原值
" v-model="model.zcyz"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">累计折旧
：</text></view>
                  <input type="number" placeholder="请输入累计折旧
" v-model="model.ljzj"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">当月折旧
：</text></view>
                  <input type="number" placeholder="请输入当月折旧
" v-model="model.dyzj"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">本年折旧
：</text></view>
                  <input type="number" placeholder="请输入本年折旧
" v-model="model.nafag"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">资产净残值
：</text></view>
                  <input type="number" placeholder="请输入资产净残值
" v-model="model.zcjcz"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">单位文本
：</text></view>
                  <input  placeholder="请输入单位文本
" v-model="model.msehl"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">净值
：</text></view>
                  <input  placeholder="请输入净值
" v-model="model.zjz"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">供应商名称
：</text></view>
                  <input  placeholder="请输入供应商名称
" v-model="model.liefe"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">供应商编号
：</text></view>
                  <input  placeholder="请输入供应商编号
" v-model="model.lifnr"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">供应商名称2
：</text></view>
                  <input  placeholder="请输入供应商名称2
" v-model="model.name1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">责任成本中心
：</text></view>
                  <input  placeholder="请输入责任成本中心
" v-model="model.kostlv"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">责任成本中心描述
：</text></view>
                  <input  placeholder="请输入责任成本中心描述
" v-model="model.ktext1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">内部订单
：</text></view>
                  <input  placeholder="请输入内部订单
" v-model="model.caufn"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">内部订单描述
：</text></view>
                  <input  placeholder="请输入内部订单描述
" v-model="model.ktext2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">工厂
：</text></view>
                  <input  placeholder="请输入工厂
" v-model="model.werks"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">工厂描述
：</text></view>
                  <input  placeholder="请输入工厂描述
" v-model="model.name2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">当前已用年限
：</text></view>
                  <input  placeholder="请输入当前已用年限
" v-model="model.zzyear"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">当前已用月份
：</text></view>
                  <input  placeholder="请输入当前已用月份
" v-model="model.zzmonth"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">状态：</text></view>
                  <input  placeholder="请输入状态" v-model="model.zstatus"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">公司代码：</text></view>
                  <input  placeholder="请输入公司代码" v-model="model.bukrs"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">更新日期：</text></view>
                  <input  placeholder="请输入更新日期" v-model="model.zdate"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">更新时间：</text></view>
                  <input  placeholder="请输入更新时间" v-model="model.ztime"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">流程ID：</text></view>
                  <input type="number" placeholder="请输入流程ID" v-model="model.requestid"/>
                </view>
              </view>
				<view class="padding">
					<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
						<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
					</button>
				</view>
			</form>
		</view>
    </view>
</template>

<script>
    import myDate from '@/components/my-componets/my-date.vue'

    export default {
        name: "ZtbZfi011LogForm",
        components:{myDate},
        props:{
          formData:{
              type:Object,
              default:()=>{},
              required:false
          }
        },
        data(){
            return {
				CustomBar: this.CustomBar,
				NavBarColor: this.NavBarColor,
				loading:false,
                model: {},
                backRouteName:'index',
                url: {
                  queryById: "/assets/ztbZfi011Log/queryById",
                  add: "/assets/ztbZfi011Log/add",
                  edit: "/assets/ztbZfi011Log/edit",
                },
            }
        },
        created(){
             this.initFormData();
        },
        methods:{
           initFormData(){
               if(this.formData){
                    let dataId = this.formData.dataId;
                    this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
                        if(res.data.success){
                            console.log("表单数据",res);
                            this.model = res.data.result;
                        }
                    })
                }
            },
            onSubmit() {
                let myForm = {...this.model};
                this.loading = true;
                let url = myForm.id?this.url.edit:this.url.add;
				this.$http.post(url,myForm).then(res=>{
				   console.log("res",res)
				   this.loading = false
				   this.$Router.push({name:this.backRouteName})
				}).catch(()=>{
					this.loading = false
				});
            }
        }
    }
</script>
